﻿<%@ Page Language="C#" AutoEventWireup="true" EnableEventValidation="false"  CodeFile="BusinessEdit.aspx.cs" Inherits="main_sales_BusinessEdit" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<%@ Register Src="../UserControls/Business_Detail.ascx" TagName="Business_Detail" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>商机报备管理</title>
    <link href="../../css/style.css" rel="stylesheet" type="text/css" />
    <link href="../../css/base.css" rel="stylesheet" type="text/css" />

    <script src="../../js/base.js" type="text/javascript" charset="utf-8"></script>

    <script src="../../js/singleeditpoint.js" type="text/javascript" charset="utf-8"></script>

    <script src="../../js/validator.js" type="text/javascript" charset="utf-8"></script>

    <script src="../../js/comm.js" type="text/javascript" charset="utf-8"></script>
    
    <script src="../../js/common.js" type="text/javascript" charset="utf-8"></script>
       <script type="text/javascript" src="../../Web_ckeditor_html/ckeditor.js"></script>
    <script type="text/javascript" src="../../Web_ckfinder_html/ckfinder.js"></script>

    <script type="text/javascript">

        function tomodifySave() { 
                //清除空格	
                TrimAllitems();       
                ClearErrMsg();
                var thisForm = document.forms[0];

                var project_name = document.getElementById("txt_PROJECT_NAME");
                var bs_name = document.getElementById("txt_BS_NAME");

                if (project_name.value == "") {
                    showErrMsg(project_name, "项目名称不能为空！");
                    project_name.focus();
                    return false;
                }

                if (bs_name.value == "") {
                    showErrMsg(bs_name, "客户全称不能为空！");
                    bs_name.focus();
                    return false;
                }
 
                var ddlProvince = document.getElementById("ddlProvince");
                if (ddlProvince != null) {
                    var ddlLoreType1 = document.getElementById("<%=ddlProvince.ClientID%>").value;
                    var ddlLoreType2 = document.getElementById("<%=ddlCity.ClientID%>").value;
                    var ddlLoreType3 = document.getElementById("<%=ddlTown.ClientID%>").value;
                    var ddlLoreType = ddlLoreType1 + ddlLoreType2 + ddlLoreType3;
                   // alert(ddlLoreType);
                    if (ddlLoreType == "") {                      
                        alert("请选择城市！");
                        return false;
                    }
                }
                var area_id = document.getElementById("ddl_AREA_ID__AREA_NAME");
                if (area_id != null) {
                   // alert(area_id.value);
                    if (area_id.value == "") {
                        showErrMsg(area_id, "请选择所属区域！");
                        area_id.focus();
                        return false;
                    }
                }
                //建议执行总价
                var txt_TOTAL = document.getElementById("txt_TOTAL");
                if (txt_TOTAL.value != "") {
                    var reg = /^[-\+]?\d+(\.\d+)?$/;
                    var chk_total = reg.test(txt_TOTAL.value);                    
                    if (!chk_total) {
                        showErrMsg(txt_TOTAL, "价格格式不正确！");
                        txt_TOTAL.focus();
                        return false;
                    }
                }
                
                
                var val = document.getElementById("txt_MEMO").value;  
				if (val.length > 30000) {
				    alert("商机报备备注长度不能大于30000");
				    val.focus();
				        return false;
				} 
				    
			 
				return true;
			}
    </script> 
    
</head>
<body>
<form name="form1" method="post" id="form1" runat="server">
  <asp:HiddenField ID="BS_ID" runat="server" />
  <asp:ScriptManager ID="smJs" runat="server">
        <Services>
            <asp:ServiceReference Path="../../SearCodintion.asmx" />
        </Services>
    </asp:ScriptManager>
    
<div class="conter_right">
<div class="sfkr"><span>当前位置：</span>商机报备管理</div>
     <fieldset class="dsadq"><legend style="color:#434449"><span id="page_title" runat="server">商机报备新增</span></legend>
      <table width="100%" border="0" cellpadding="0" cellspacing="0" class="msels">
       <tr id="tr_AREA_ID" runat="server">
                   <td align="right" valign="middle">
                         <asp:Label ID="lbl_AREA_ID__AREA_NAME" runat="server" Text="所属区域："></asp:Label>
                    </td>
                    <td align="left" valign="middle" colspan="3">
                      <asp:DropDownList ID="ddl_AREA_ID__AREA_NAME" runat="server" CanZhao="AREA_NAME"
                            TiaoJian="DEL_FLG|0|3" dataType="Require" msg="不能为空" CssClass="saae">
                        </asp:DropDownList>
                        <asp:Label ID="err_AREA_ID__AREA_NAME" runat="server"></asp:Label>
                    </td>                    
      </tr>
     <tr>     
      <td width="16%" align="right" valign="middle">
      <asp:Label ID="lbl_PROJECT_NAME" runat="server" Text="项目名称"></asp:Label>：</td>
        <td width="34%" align="left" valign="middle" >
           <asp:TextBox MaxLength="150" CssClass="srjks"  Width="238px" ID="txt_PROJECT_NAME" runat="server"  dataType="Require" msg="项目名称不能为空！" ></asp:TextBox>
                                        <asp:Label ID="err_PROJECT_NAME" runat="server"></asp:Label></td>
         <td width="16%" align="right" valign="middle">
      <asp:Label ID="lbl_BS_NAME" runat="server" Text="客户全称"></asp:Label>：</td>
        <td width="34%" align="left" valign="middle" >
           <asp:TextBox MaxLength="150" CssClass="srjks"  Width="238px" ID="txt_BS_NAME" runat="server"  dataType="Require" msg="客户全称不能为空！" ></asp:TextBox>
                                        <asp:Label ID="err_BS_NAME" runat="server"></asp:Label></td>
     </tr>
	 <tr>
                    <td align="right" valign="middle">
                        <asp:Label ID="lbl_BS_CONTCAT" runat="server" Text="客户联系人："></asp:Label>
                    </td>
                    <td align="left" valign="middle">
                        <asp:TextBox ID="txt_BS_CONTCAT" runat="server" CssClass="srjks" MaxLength="100" Width="250px"
                            dataType="Require" msg="不能为空" ></asp:TextBox>
                        <asp:Label ID="err_BS_CONTCAT" runat="server"></asp:Label>
                    </td>
                    <td align="right" valign="middle">
                        <asp:Label ID="lbl_BS_PHONE" runat="server" Text="客户联系电话："></asp:Label>
                    </td>
                    <td align="left" valign="middle">
                        <asp:TextBox ID="txt_BS_PHONE" runat="server" CssClass="srjks" MaxLength="100" Width="250px"
                            dataType="Require" msg="不能为空" ></asp:TextBox>
                        <asp:Label ID="err_BS_PHONE" runat="server"></asp:Label>
                    </td>
                </tr>
	<tr>     		
		<td width="16%" align="right" valign="middle">
			<font color="red">*&nbsp;</font><asp:Label ID="lbl_CITY_ID" runat="server" Text="城市"></asp:Label>：
		</td>
		<td width="34%" align="left" valign="middle" >
						<asp:DropDownList ID="ddlProvince" runat="server">
						</asp:DropDownList>
						&nbsp;
						<ajaxtoolkit:cascadingdropdown id="cddProvince" runat="server" servicepath="../../SearCodintion.asmx"
							servicemethod="GetProvince" category="Province" targetcontrolid="ddlProvince"
							prompttext="请选择省市" loadingtext="加载中...">
						</ajaxtoolkit:cascadingdropdown>
						<asp:DropDownList ID="ddlCity" runat="server">
						</asp:DropDownList>
						<ajaxtoolkit:cascadingdropdown id="cddCity" runat="server" targetcontrolid="ddlCity"
							servicepath="../../SearCodintion.asmx" servicemethod="GetCity" category="City"
							prompttext="---" loadingtext="加载中..." parentcontrolid="ddlProvince">
						 </ajaxtoolkit:cascadingdropdown>
						<asp:DropDownList ID="ddlTown" runat="server">
						</asp:DropDownList>
						<ajaxtoolkit:cascadingdropdown id="cddTown" runat="server" targetcontrolid="ddlTown"
							servicepath="../../SearCodintion.asmx" servicemethod="GetTown" category="Town"
							prompttext="---" loadingtext="加载中..." parentcontrolid="ddlCity"></ajaxtoolkit:cascadingdropdown>
			<asp:Label ID="err_CITY_ID" runat="server"></asp:Label>
		</td>
		 
 <td align="right" valign="middle">
                        <asp:Label ID="lbl_PURCHASE" runat="server" Text="采购形式："></asp:Label>
                    </td>
                    <td align="left" valign="middle">
                        <asp:RadioButtonList ID="ddl_PURCHASE" runat="server" RepeatDirection="Horizontal" DefaultOption="1" />
                        <asp:Label ID="err_PURCHASE" runat="server"></asp:Label>
                    </td>
	</tr>
	 
         
	<tr>     
		<td width="16%" align="right" valign="middle">
			<asp:Label ID="lbl_ORDER_DATE" runat="server" Text="预计交货日期"></asp:Label>：
		</td>
		<td width="34%" align="left" valign="middle" >
			 <asp:TextBox ID="txt_ORDER_DATE" runat="server" CssClass="srjks" MaxLength="30" Width="100px"  ReadOnly
								 Require="true"></asp:TextBox>
			<asp:Label ID="err_ORDER_DATE" runat="server"></asp:Label>
		</td>
		<td width="16%" align="right" valign="middle">
			<asp:Label ID="lbl_TOTAL" runat="server" Text="建议执行总价"></asp:Label>：
		</td>
		<td width="34%" align="left" valign="middle" >
		<asp:TextBox MaxLength="8" CssClass="srjks"  Width="130px" ID="txt_TOTAL" runat="server" dataType="Double" msg="格式不正确！"></asp:TextBox>
			<asp:Label ID="err_TOTAL" runat="server"></asp:Label>
		</td>
	</tr>
	
	
	<tr>     
		<td width="16%" align="right" valign="middle">
			<asp:Label ID="lbl_BIDDING_DATE" runat="server" Text="招标日期:"></asp:Label>：
		</td>
		<td width="34%" align="left" valign="middle" >
			 <asp:TextBox ID="txt_BIDDING_DATE" runat="server" CssClass="srjks" MaxLength="30" Width="100px"  ReadOnly
								 Require="true"></asp:TextBox>
			<asp:Label ID="err_BIDDING_DATE" runat="server"></asp:Label>
		</td>
		<td width="16%" align="right" valign="middle">
			<asp:Label ID="lbl_CHANCE" runat="server" Text="机会率:"></asp:Label>：
		</td>
		<td width="34%" align="left" valign="middle" >
		<asp:TextBox MaxLength="8" CssClass="srjks"  Width="130px" ID="txt_CHANCE" runat="server" ></asp:TextBox>
			<asp:Label ID="err_CHANCE" runat="server"></asp:Label>
		</td>
	</tr>
	 <tr id="tr_PARTNER_ID" runat="server">
                   <td align="right" valign="middle">
                         <asp:Label ID="lbl_PARTNER_ID__COMPANY_NAME" runat="server" Text="合作渠道："></asp:Label>
                    </td>
                    <td align="left" valign="middle" colspan="3">
                      <asp:DropDownList ID="ddl_PARTNER_ID__COMPANY_NAME" runat="server" CanZhao="COMPANY_NAME"
                            TiaoJian="POST|0|3" dataType="Require" msg="不能为空" CssClass="saae">
                        </asp:DropDownList>
                        <asp:Label ID="err_PARTNER_ID__COMPANY_NAME" runat="server"></asp:Label>
                    </td>                    
      </tr>     
   <tr>     
      <td width="16%" align="right" valign="middle"><asp:Label ID="lbl_COMPETITOR" runat="server" Text="竞争对手基本情况"></asp:Label>：</td>
        <td width="84%" align="left" valign="middle" colspan="4" >
            <asp:textBox  id="txt_COMPETITOR" runat="server" cols="60" rows="6" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" 
                TextMode="MultiLine" Width="488px"></asp:textBox> 
                <asp:Label ID="err_COMPETITOR" runat="server"></asp:Label></td>
     
     </tr>
     
   <tr>     
      <td width="16%" align="right" valign="middle"><asp:Label ID="lbl_SUPPORT" runat="server" Text="需要提供的支持"></asp:Label>：</td>
        <td width="84%" align="left" valign="middle" colspan="4" >
            <asp:textBox  id="txt_SUPPORT" runat="server" cols="60" rows="6" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" 
                TextMode="MultiLine" Width="488px"></asp:textBox> 
                <asp:Label ID="err_SUPPORT" runat="server"></asp:Label></td>
     
     </tr>
      
     <tr>     
      <td width="16%" align="right" valign="middle"><asp:Label ID="lbl_MEMO" runat="server" Text="备注"></asp:Label>：</td>
        <td width="84%" align="left" valign="middle" colspan="4" >
            <asp:textBox  id="txt_MEMO" runat="server" cols="60" rows="6" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" 
                TextMode="MultiLine" Width="488px"></asp:textBox> 
                <asp:Label ID="err_MEMO" runat="server"></asp:Label></td>
     
     </tr>
     <tr id="tr_report"  runat="server">     
      <td width="16%" align="right" valign="middle"><asp:Label ID="lbl_REPORT" runat="server" Text="完成报告"></asp:Label>：</td>
        <td width="84%" align="left" valign="middle" colspan="3" >
            <asp:textBox  id="txt_REPORT" runat="server" cols="60" rows="6" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" 
                TextMode="MultiLine" Width="488px"></asp:textBox> 
                <asp:Label ID="err_REPORT" runat="server"></asp:Label></td>
     
     </tr>
      <tr id="tr_status"  runat="server">
                  <td align="right" valign="middle">
                        <asp:Label ID="lbl_STATUS" runat="server" Text="状态："></asp:Label>
                    </td>
                    <td align="left" valign="middle" colspan="3">
                        <asp:RadioButtonList ID="ddl_STATUS" runat="server" RepeatDirection="Horizontal" DefaultOption="1" />
                        <asp:Label ID="err_STATUS" runat="server"></asp:Label>
                    </td>                 
      </tr>
     </table>
     </fieldset>
     </div>

<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <uc1:Business_Detail runat="server" ID="uc_Business_Detail" />
            </ContentTemplate>
</asp:UpdatePanel>
        
      <div style="height:15px"></div>
        <div class="nstkaah" align="center" style="width:90%">  
         <asp:Button runat="server" Text="新增明细" CssClass="seaal" ID="btn_AddDetail" ToolTip="新增明细" 
                                         OnClientClick="return  addDetail();"    />
        <asp:Button runat="server" Text="保存" CssClass="seaal" ID="queding" ToolTip="保存" 
                                         OnClientClick="return  tomodifySave();"   OnClick="queding_Click" />
                                         <asp:Button runat="server" Text="返回" CssClass="seaal" ID="Button3" ToolTip="返回" OnClick="cmdCancel_Click" />
              </div>
              
	<!--jjjjjjjjjjjjjjjjjjjj页脚部分jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj-->
	<div id="footer"></div>
	
	<script language='javascript' type="text/javascript">
	    SetCalendar('txt_ORDER_DATE'); SetCalendar('txt_BIDDING_DATE');
	    
    </script>
   </form>
   <div style="color:Red; padding-left:10px; margin-right:100px;"> 提示:<br />
                        &nbsp;&nbsp;&nbsp;&nbsp; 新增商机报备明细请先保存项目。 
</div>
</body>
</html>
